<template>
	<view class="transpose">
		<p>当前绑定手机号</p>
		<h3>{{mobile}}</h3>
		<button v-if="type == 0" @click="skip('/pages/user/list/Change_phone/Change_phone?mobile='+mobile)">修改手机号</button>
		<button v-if="type == 1" @click="destory">注销手机号</button>
		<button class="button" @click='skip("/pages/user/list/safety/safety?mobile="+mobile)'>返回</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: 0,
				mobile: "",
			};
		},
		methods: {
			skip(url) {
				uni.redirectTo({
					url,
				})
			},
			destory() {
				uni.showModal({
					title: '注销手机号',
					content: '您确认要注销手机号吗？注销后所有数据都会销毁！！！',
					success: (res) => {
						if (res.confirm) {
							this.$httpRequest('/user/unbindMobile').then(res => {

							});
						} else if (res.cancel) {}
					}
				});
			},
		},
		onLoad(option) {
			this.mobile = option.mobile;
			this.type = option.type;
		}
	}
</script>

<style lang="less">
	.transpose {
		text-align: center;
		padding-top: 56rpx;

		&>p {
			font-size: 12px;
			color: #666666;
		}

		&>h3 {
			font-size: 20px;
			color: #333333;
			margin: 20rpx 0 100rpx;
		}

		&>.button {
			background: #C2C2C2;
		}

		&>button {
			width: 690rpx;
			height: 80rpx;
			line-height: 80rpx;
			color: #fff;
			background: #5FC07B;
			font-size: 15px;
			margin-top: 44rpx;
		}
	}
</style>